package cn.joyfulmedia.dao;

import cn.joyfulmedia.common.util.page.Pagination;
import cn.joyfulmedia.entity.ExamMisRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ExamMisRoleMapper {
    /**
     * 保存
     */
    public Integer saveRole(ExamMisRole entity) throws Exception;

    /**
     * 修改
     */
    public Integer updateRoleById(ExamMisRole entity) throws Exception;

    /**
     * 根据ID查找
     *
     * @param id
     * @return
     * @throws Exception
     */
    ExamMisRole selectRoleById(Object id) throws Exception;

    Integer listPageCount(@Param("role") ExamMisRole role);

    List<ExamMisRole> listPage(@Param("role") ExamMisRole role, @Param("pagination") Pagination pagination);

    /**
     * 根据角色id删除该角色所有权限
     *
     * @param id
     * @return
     */
    public Integer delPermBYId(Long id);

    /**
     * 给角色设置权限
     *
     * @param rid
     * @param id
     * @return
     */
    public Integer bathSavePerm(@Param("rids") Long[] rid, @Param("id") Long id);

    public Integer delRoleBYId(Long id);

    public Integer bathSaveRole(@Param("rids") Long[] rid, @Param("id") Long id);

    public List<ExamMisRole> findByAccountId(Long id);

    int deleteByPrimaryKey(Integer id);

    int insert(ExamMisRole record);

    int insertSelective(ExamMisRole record);

    ExamMisRole selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ExamMisRole record);

    int updateByPrimaryKeyWithBLOBs(ExamMisRole record);

    int updateByPrimaryKey(ExamMisRole record);
}